(use-modules (guix packages) (guix git-download) (guix build-system python) (gnu packages)
 (gnu packages python-xyz) (gnu packages check) (guix gexp) (gnu packages python)
 (guix profiles) (gnu packages machine-learning)
 (gnu packages qt)
 (gnu packages video)
 (guix download)
 (gnu packages python-science)
;; (gnu packages python-)
 ((guix licenses) #:prefix license:))

(define-public python-intersect
(package
  (name "python-intersect")
  (version "1.2")
  (source
    ;; The README loaded by setup.py is missing from the pypi tarball, so
    ;; build from git instead.  The commit
    ;; bec8adc2573fd8428a561a2d32db57e864137036 seems to be the commit
    ;; the tarball was based upon.  However, this commit contains compiled
    ;; compiled python code, so use a later commit that removed these binaries.
    ;; There are no other differences except for changes to the readme.md.
    (origin
      (method git-fetch)
      (uri
        (git-reference
          (url "https://github.com/sukhbinder/intersection")
          (commit "05af4878d5d528b9cccc721a81b549fa2b209c34")))
      (sha256
        (base32 "0w45i758wz5yslkjpms323v8paqnhhn3pfkvld07bh0w9filyp6x" #;"2jfp12ccljs92x5asxm5hiw40z49j3h8nxkqsnjjb38cfkrs7zll"))))
  (build-system python-build-system)
  (native-inputs (list python-pytest python-setuptools-scm))
  (propagated-inputs (list python-numpy))
  (home-page "https://github.com/sukhbinder/intersection")
  (synopsis "Intersection of two curves")
  (description "Intersection of two curves")
  (license license:expat)))

(define-public python-ithildin
(package
  (name "python-ithildin")
  (version "0.3.1")
  (source
    (origin
      (method git-fetch)
      (uri
        (git-reference
          ;; The official location is at https://gitlab.kuleuven.be, but that's
          ;; not publicly accessible.
          (url "https://gitlab.com/heartkor/py_ithildin")
          (commit "610d9d0f1d68214c2835599d674a93e48e92dd05")))
      (sha256
        (base32 "0bqvv6zc6mp44xipj18v53951v27d96a816p84xl2ig0hrb348zi" #;"09s1ig80qrn6iw8rbyicf8j2bvgvp0f77j2j3xjddrnaa06jrl9w"))))
  (build-system python-build-system)
  (native-inputs (list python-setuptools python-setuptools-scm))
  (propagated-inputs
    (list python-numpy python-scipy
          python-click
          python-matplotlib
          python-networkx
          python-numpy
          python-scipy
          python-pyyaml
          python-intersect))
  ;; TODO: add ffmpeg
  (arguments
    (list #:phases
          #~(modify-phases %standard-phases
              ;; Upstream's setup.py does not set the 'version' field and
              ;; instead relies on python-setuptools-scm to determine the
              ;; version, but in the build environment python-setuptools-scm
              ;; does not have enough information do determine the version.
              ;; Help setup.py with determining the version number.
              (add-after 'unpack 'find-version
                (lambda _
                  (substitute* "setup.py"
                    (("use_scm_version=True")
                     (format #f "version=\"~a\"" #$version))
                    (("^setup_requires=.*$") "")))))))
  (home-page "https://github.com/heartkor/py_ithildin")
  (synopsis #f)
  (description #f)
  (license license:gpl3)))

;; 4wells_traj.npy, *.npy

(define-public python-pydiffmap
  (package
  (name "python-pydiffmap")
  (version "0.2.0.1")
  (source
    (origin
      (method url-fetch)
      (uri (pypi-uri "pydiffmap" version))
      (sha256
        (base32 "0hm003jfcb73gblc4abb36i7sc7gqcisj84vrggnibd7x7ajvxis"))))
  (build-system python-build-system)
  (propagated-inputs
    (list python-matplotlib
          python-numexpr
          python-numpy
          python-scikit-learn
          python-scipy
          python-six))
  (home-page "https://github.com/DiffusionMapsAcademics/pyDiffMap")
  (synopsis "Library for constructing variable bandwidth diffusion maps")
  (description "Library for constructing variable bandwidth diffusion maps")
  (license license:expat)))

(packages->manifest
  (list (specification->package "emacs")
        (specification->package "emacs-elpy")
        (specification->package "emacs-magit")
        (specification->package "git")
        (specification->package "python-wrapper")
        (specification->package "glibc-locales")
        (specification->package "glibc")
        (specification->package "coreutils")
        (specification->package "bash")
	ffmpeg
        python-pydiffmap
	python-pyqt
        python python-ithildin))
